<div [@routerTransition]>
    <div class="m-subheader">
        <div class="d-flex align-items-center">
            <div class="mr-auto col-xs-6">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>五菱地址库</span>
                </h3>
                <span class="m-section__sub">
                    <!-- {{l("UsersHeaderInfo")}} -->
                </span>
            </div>
            <div class="col-xs-6 text-right">
                <form #logoUploadForm>
                    <div class="form-group">
                        <input type="file" ng2FileSelect [uploader]="excelUploader" class="col-lg-12" required  value="导入"/>
                        <!-- <span class="m-form__help col-lg-12">选择文件</span> -->
                    </div>

                    <!-- <button (click)="importExcel()" class="btn btn-primary"><i class="fa fa-plus"></i> 开始导入</button> -->
                </form>
                <!-- <button (click)="createUser()" *ngIf="isGranted('Pages.Administration.Users.Create')" class="btn btn-primary"><i
              class="fa fa-plus"></i> {{l("CreateNewUser")}}</button> -->
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body">
                <form class="horizontal-form" autocomplete="off">
                    <div class="m-form m-form--label-align-right">
                        <div class="row align-items-center m--margin-bottom-10">
                            <div class="col-xl-12">
                                <div class="form-group m-form__group align-items-center">
                                    <div class="input-group">
                                        <input [(ngModel)]="filterText" name="filterText" autoFocus class="form-control m-input"
                                            [placeholder]="l('SearchWithThreeDot')" type="text">
                                        <span class="input-group-btn">
                                            <button (click)="getAddresss()" class="btn btn-primary" type="submit"><i class="flaticon-search-1"
                                                    [attr.aria-label]="l('Search')"></i></button>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>

                         

                        <div class="row margin-bottom-10" *ngIf="advancedFiltersAreShown">
                            <div class="col-sm-12 text-right">
                                <button class="btn btn-metal" (click)="getAddresss()"><i class="fa fa-refresh"></i>
                                    {{l("Refresh")}}</button>
                            </div>
                        </div>
                        <div class="row margin-bottom-10">
                            <div class="col-sm-12">
                                <span class="clickable-item text-muted" *ngIf="!advancedFiltersAreShown" (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i
                                        class="fa fa-angle-down"></i> {{l("ShowAdvancedFilters")}}</span>
                                <span class="clickable-item text-muted" *ngIf="advancedFiltersAreShown" (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i
                                        class="fa fa-angle-up"></i> {{l("HideAdvancedFilters")}}</span>
                            </div>
                        </div>
                    </div>
                </form>

                <div class="row align-items-center">
                    <!--<Primeng-TurboTable-Start>-->
                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                        <p-table #dataTable (onLazyLoad)="getAddresss($event)" [value]="primengTableHelper.records"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                            [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 130px" [hidden]="!isGrantedAny('Pages.Manager.WulingAddressLibrary')">{{l('Actions')}}</th>
                                    <th style="width: 150px" pSortableColumn="serviceStationCode">
                                        服务站代码
                                        <p-sortIcon field="serviceStationCode"></p-sortIcon>
                                    </th>
                                    <th style="width: 150px" pSortableColumn="serviceStationName">
                                        服务站名称
                                        <p-sortIcon field="serviceStationName"></p-sortIcon>
                                    </th>
                                    <th style="width: 150px" pSortableColumn="postCode">
                                        邮编
                                        <p-sortIcon field="postCode"></p-sortIcon>
                                    </th>
                                    <th style="width: 150px">
                                        联系人
                                        <p-sortIcon field="contact"></p-sortIcon>
                                    </th>
                                    <th style="width: 250px" pSortableColumn="contactPhoneNumber">
                                        联系人电话
                                        <p-sortIcon field="contactPhoneNumber"></p-sortIcon>
                                    </th>
                                    <th style="width: 200px" pSortableColumn="receiverAddress">
                                        收货地址
                                        <p-sortIcon field="receiverAddress"></p-sortIcon>
                                    </th>
                                    <th style="width: 100px" pSortableColumn="serviceStationManager">
                                        服务站经理
                                        <p-sortIcon field="serviceStationManager"></p-sortIcon>
                                    </th>
                                    <th style="width: 200px" pSortableColumn="serviceStationManagerPhoneNumber">
                                        经理联系电话
                                        <p-sortIcon field="serviceStationManagerPhoneNumber"></p-sortIcon>
                                    </th>
                                    <th style="width: 200px" pSortableColumn="area">
                                        区域
                                        <p-sortIcon field="area"></p-sortIcon>
                                    </th>
                                    <th style="width: 200px" pSortableColumn="province">
                                        省份
                                        <p-sortIcon field="province"></p-sortIcon>
                                    </th>
                                    <th style="width: 200px" pSortableColumn="city">
                                        城市
                                        <p-sortIcon field="city"></p-sortIcon>
                                    </th>
                                    <th style="width: 200px" pSortableColumn="district">
                                        区
                                        <p-sortIcon field="district"></p-sortIcon>
                                    </th>
                                    <th style="width: 200px" pSortableColumn="creationTime">
                                        {{l('CreationTime')}}
                                        <p-sortIcon field="creationTime"></p-sortIcon>
                                    </th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit">
                                <tr>
                                    <td style="width: 130px" [hidden]="!isGrantedAny('Pages.Manager.WulingAddressLibrary')">
                                        <div class="btn-group dropdown" dropdown container="body">
                                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                                                <i class="fa fa-cog"></i><span class="caret"></span> {{l("Actions")}}
                                            </button>
                                            <ul class="dropdown-menu" *dropdownMenu> 
                                                <li>
                                                    <a href="javascript:;"  
                                                        (click)="editModal.show(record.id)">{{l('Edit')}}</a>
                                                </li>
                                                 
                                                <li>
                                                    <a href="javascript:;"  
                                                        (click)="delete(record)">{{l('Delete')}}</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> {{l('UserName')}}</span>
                                        {{record.serviceStationCode}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> {{l('Name')}}</span>
                                        {{record.serviceStationName}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> {{l('Surname')}}</span>
                                        {{record.postCode}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> {{l('Roles')}}</span>
                                        {{record.contact}}
                                    </td>
                                    <td style="width: 250px">
                                        <span class="ui-column-title"> {{l('EmailAddress')}}</span>
                                        {{record.contactPhoneNumber}}
                                    </td>
                                    <td style="width: 200px">
                                        <span class="ui-column-title"> {{l('EmailConfirm')}}</span>
                                        {{record.receiverAddress}}
                                        <!-- <span class="label label-success" *ngIf="record.isEmailConfirmed">{{l('Yes')}}</span>
                                            <span class="label label-default" *ngIf="!record.isEmailConfirmed">{{l('No')}}</span> -->
                                    </td>
                                    <td style="width: 100px">
                                        <span class="ui-column-title"> {{l('Active')}}</span>
                                        {{record.serviceStationManager}}
                                    </td>
                                    <td style="width: 200px">
                                        <span class="ui-column-title"> {{l('LastLoginTime')}}</span>
                                        {{record.serviceStationManagerPhoneNumber}}
                                        <!-- <span *ngIf="record.lastLoginTime">{{record.lastLoginTime | momentFormat:'L'}}</span>
                                            <span *ngIf="!record.lastLoginTime">-</span> -->
                                    </td>
                                    <td style="width: 200px">
                                        <span class="ui-column-title"> {{l('CreationTime')}}</span>
                                        {{record.area}}
                                        <!-- {{record.creationTime | momentFormat:'L'}} -->
                                    </td>
                                    <td style="width: 200px">
                                        <span class="ui-column-title"> {{l('CreationTime')}}</span>
                                        {{record.province}}
                                        <!-- {{record.creationTime | momentFormat:'L'}} -->
                                    </td>
                                    <td style="width: 200px">
                                        <span class="ui-column-title"> {{l('CreationTime')}}</span>
                                        {{record.city}}
                                        <!-- {{record.creationTime | momentFormat:'L'}} -->
                                    </td>
                                    <td style="width: 200px">
                                        <span class="ui-column-title"> {{l('CreationTime')}}</span>
                                        {{record.district}}
                                        <!-- {{record.creationTime | momentFormat:'L'}} -->
                                    </td>
                                    <td style="width: 200px">
                                        <span class="ui-column-title"> {{l('CreationTime')}}</span>
                                        {{record.creationTime | momentFormat:'L'}}
                                    </td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                            {{l('NoData')}}
                        </div>
                        <div class="primeng-paging-container">
                            <p-paginator rows="{{primengTableHelper.defaultRecordsCountPerPage}}" #paginator
                                (onPageChange)="getAddresss($event)" [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                            </p-paginator>
                            <span class="total-records-count">
                                {{l('TotalRecordsCount', primengTableHelper.totalRecordsCount)}}
                            </span>
                        </div>
                    </div>
                    <!--<Primeng-TurboTable-End>-->
                </div>
            </div>
        </div>
    </div>

</div>